import instance from "./index";
export function getUserDjm() {
  return instance({
    url: "/user",
    method: "GET",
  });
}
export function addUser(data) {
  return instance({
    url: "/addUser",
    method: "POST",
    data,
  });
}
export function getUser2Djm(id) {
  return instance({
    url: `/getUser/${id}`,
    method: "get",
  });
}
export function putUserDjm(data) {
  return instance({
    url: `/putUser/${data.id}`,
    method: "put",
    data,
  });
}

export function AddUserDjm(data) {
  return instance({
    url: `/bx/add`,
    method: "post",
    data,
  });
}

export function getmsjhomes() {
  return instance({
    url: "/msjhomes",
    method: "GET",
  });
}

export function getmsjhomesdeatil(id) {
  return instance({
    url: `/msjhomes/${id}`,
    method: "GET",
  });
}

//彩市场
export function getweicsc() {
  return instance({
    url: "/weicsc",
    method: "GET",
  });
}
export function putweicsc(data) {
  return instance({
    url: "/putweicsc/"+data.id,
    method: "PUT",
    data
  });
}
//市场详情
// export function getweishingc() {
//   return instance({
//     url: '/weishingc',
//     method: 'GET',
//   })
// }
//评论
export function addweishingc(data) {
  return instance({
    url: `/addweishingc/${data.id}`,
    method: "put",
    data,
  });
}
//商品发布
export function getweifanbu() {
  return instance({
    url: "/weifanbu",
    method: "GET",
  });
}
export function addweicsc(data) {
  console.log(data);
  return instance({
    url: "/addweicsc",
    method: "post",
    data,
  });
}
export function gethgjhd() {
  return instance({
    url: "/bx",
    method: "get",
  });
}
export function delhgjhd(id) {
  return instance({
    url: "/bx/del/"+ id,
    method: "delete",
  });
}
export function delweicsc(id) {
  return instance({
    url: "/delweicsc/"+ id,
    method: "delete",
  });
}
export function gethgjhddetail(id) {
  return instance({
    url: `/bx/${id}`,
    method: "get",
  });
}

export function puthgjdetail(data) {
  console.log(data);
  return instance({
    url: `/bx/updatebx/${data.id}`,
    method: "put",
    data,
  });
}
//订单
export function zwydingdanAdd(data) {
  console.log(data);
  return instance({
    url: "/zwydingdanAdd",
    method: "post",
    data,
  });
}
export function zwydingdan() {
  return instance({
    url: "/zwydingdan",
    method: "GET"
  });
}
export function puzwydingdan(data) {
  return instance({
    url: "/puzwydingdan/" + data.id,
    method: "PUT",
    data
  });
}
